package cn.jbt.api.admin.entity.dto;

import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ModifyUserDTO {

    @Pattern(regexp = "^1[3456789][0-9]{9}$", message = "手机号码格式错误")
    @NotBlank(message = "手机号码不能为空")
    private String mobile;

    @NotBlank(message = "用户昵称不能为空")
    private String nickname;

    @Pattern(regexp = "^$|^\\w+((-\\w+)|(\\.\\w+))*@\\w+(\\.\\w{2,3}){1,3}$", message = "邮箱格式错误")
    private String email = "";

    @NotNull(message = "性别不能为空")
    @Min(value = 0, message = "性别'值'错误")
    @Max(value = 2, message = "性别'值'错误")
    private Integer sex;
}
